package ae.pcfc.cldos.online.common.facade.service.provider;

import java.util.Map;

import ae.pcfc.cldos.online.common.exception.LocatorException;
import ae.pcfc.cldos.online.common.facade.Facade;
import ae.pcfc.cldos.online.common.facade.service.BaseServiceLocator;
import ae.pcfc.cldos.online.common.facade.service.ServiceLocator;

/**
 * Service locator implementation
 * 
 * @author arosa
 *
 */
public class ServiceLocatorImpl extends BaseServiceLocator implements ServiceLocator{
	
	@SuppressWarnings("rawtypes")
	private Map<Class, Facade> facadesMap;
	
	@Override
	@SuppressWarnings("unchecked")
	public <T extends Facade> T getFacadeService(Class<T> type)
			throws LocatorException {
		return (T) facadesMap.get(type);
	}
	
	public void setFacadesMap(@SuppressWarnings("rawtypes") Map<Class, Facade> facadesMap) {
		this.facadesMap = facadesMap;
	}

}
